Skip to content

feat: env remove command supports the ".env" file for Bolt Framework apps#457

Merged
zimeg merged 2 commits intomainfrom
zimeg-feat-dotenv-remove
Apr 2, 2026
Merged

feat: env remove command supports the ".env" file for Bolt Framework apps#457
zimeg merged 2 commits intomainfrom
zimeg-feat-dotenv-remove

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Apr 1, 2026

Changelog

The slack env remove command will remove environment variables from the .env file for apps that aren't built or run on Slack infrastructure.

Summary

This PR brings support for Bolt frameworks removing variables from the .env file with the env remove command! 🧾

$ slack env remove

Follows #437 and #451 and #456 recent.

Preview

demo

Reviewers

Use the various env commands to interact with this file:

$ cat .env
# Tests follow
EXAMPLE_VARIABLE=12
PLACEHOLDER="false"           # Leftover comments
DATABASE_SECRET="---start---
EOF
---end---"
DETAILS=
$ slack env list
$ slack env remove
$ slack env list
$ cat .env

Notes

  • ROSI continue to call the API. For local development the .env file is now supported.
  • Inlined comments for a removed variable are also removed. This is different from env add but might make sense?

Requirements

@zimeg zimeg added this to the Next Release milestone Apr 1, 2026
@zimeg zimeg self-assigned this Apr 1, 2026
@zimeg zimeg requested a review from a team as a code owner April 1, 2026 23:40
@zimeg zimeg added enhancement M-T: A feature request for new functionality changelog Use on updates to be included in the release notes semver:minor Use on pull requests to describe the release version increment area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 85.84071% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.02%. Comparing base (24c1d2c) to head (d6e4207).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/env/remove.go 87.17% 5 Missing and 5 partials ⚠️
internal/slackdotenv/slackdotenv.go 82.85% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
+ Coverage   70.96%   71.02%   +0.05%     
==========================================
  Files         220      220              
  Lines       18466    18531      +65     
==========================================
+ Hits        13105    13162      +57     
- Misses       4183     4188       +5     
- Partials     1178     1181       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Great work @zimeg! The design of this command is starting to showcase we how want all of our commands to be structure - linear flow in cmd/ with clean calls into internal/.

🧪 Manual test works well! I noticed removing an non-existent key will output success, which isn't wrong and reasonable for our first release!

},
}))
} else {
err := slackdotenv.Unset(clients.Fs, variableName)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nice and clean 👌🏻

@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Apr 2, 2026

@mwbrooks Thanks so much for the review and thoughts to these changes!

I'm also a fan of these command patterns and do hope it brings organization to other packages that we might want to untangle 🎁

Let's get this merged to complete Bolt support for these commands - I agree that follow up remains but I'm feeling alright with these changes overall 🌲

@zimeg zimeg merged commit a8724bf into main Apr 2, 2026
8 checks passed
@zimeg zimeg deleted the zimeg-feat-dotenv-remove branch April 2, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants